import CommonUtils from "../../utils/CommonUtils";

// 文档目录对象
const menuObj = {
    "menuName": "",
    "desc": "",
    "apiId": null,
    "parentId": 1,
    "menuType": 2,
    "orderNum": 1,
    "idPath": "1",
    "enableFlag": 0,
}

// 接口目录对象
const apiMenu = {
    "id": null,
    "menuName": "",
    "desc": "",
    "apiId": null,
    "parentId": 2,
    "menuType": 0,
    "orderNum": 2,
    "idPath": "1,2",
    "enableFlag": 1,
    "apiName": null,
    "stateId": null,
    "apiDesc": null,
    "apiUri": null,
    "apiHeader": null,
    "apiType": null,
    "serverId": null,
    "serverName": null,
    "serverDesc": null,
    "children": null
}

// 字段对象
const apiFieldObj = {
    "apiId": 1,
    "fieldName": "",
    "fieldMust": "否",
    "fieldDesc": "",
    "enableFlag": 1,
    "fieldTypeId": 1
}

// 字段显示对象
const fieldTbObj = [
    {
        id: 0,
        name: '序号',
        field: 'fieldName',
        size: 60
    },
    {
        id: 1,
        name: '字段',
        field: 'fieldName',
        size: 200
    },
    {
        id: 2,
        name: '字段类型',
        field: 'fieldTypeId',
        size: 110
    },
    {
        id: 3,
        name: '是否必须',
        field: 'fieldMust',
        size: 90
    },
    {
        id: 4,
        name: '字段通用说明',
        field: 'fieldDesc',
        size: 400
    },
    {
        id: 5,
        name: '最后修改时间',
        field: 'updateTime',
        size: 150
    },
    {
        id: 6,
        name: '操作',
        field: 'updateTime',
        size: 100
    },
    {
        id: 7,
        name: '接口',
        field: 'apiId',
        size: 200
    },
    {
        id: 8,
        name: '启停用',
        field: 'enableFlag',
        size: 100
    }
]

function getMenuObj() {
    return CommonUtils.cloneObj(menuObj)
}

function getApiMenuObj() {
    return CommonUtils.cloneObj(apiMenu)
}

function getFieldObj() {
    return CommonUtils.cloneObj(apiFieldObj)
}

export default {
    getMenuObj, getApiMenuObj, fieldTbObj, getFieldObj
}